Pull out the SMLAN server. Its very out of date and not used, besides the SMO server can act as a lan server.
This commit is contained in:
@@ -149,7 +149,6 @@ public:
|
||||
|
||||
PacketFunctions m_SMOnlinePacket;
|
||||
|
||||
bool isLanServer; //Must be public for ScreenNetworkOptions
|
||||
StepManiaLanServer *LANserver;
|
||||
|
||||
int GetSMOnlineSalt();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,169 +0,0 @@
|
||||
#ifndef NetworkSyncServer_H
|
||||
#define NetworkSyncServer_H
|
||||
|
||||
#include "NetworkSyncManager.h"
|
||||
|
||||
#if !defined(WITHOUT_NETWORKING)
|
||||
#include "ezsockets.h"
|
||||
#define NETMAXBUFFERSIZE 1020
|
||||
|
||||
class LanPlayer
|
||||
{
|
||||
public:
|
||||
RString name;
|
||||
long score;
|
||||
int health;
|
||||
int feet;
|
||||
int projgrade;
|
||||
int combo;
|
||||
int currstep;
|
||||
int steps[9];
|
||||
int maxCombo;
|
||||
int Grade;
|
||||
double offset;
|
||||
int PlayerID;
|
||||
int diff;
|
||||
RString options;
|
||||
LanPlayer();
|
||||
};
|
||||
|
||||
class GameInfo
|
||||
{
|
||||
public:
|
||||
RString title;
|
||||
RString subtitle;
|
||||
RString artist;
|
||||
RString course;
|
||||
};
|
||||
|
||||
class GameClient
|
||||
{
|
||||
public:
|
||||
bool GotStartRequest;
|
||||
EzSockets clientSocket;
|
||||
void UpdateStats(PacketFunctions &Packet);
|
||||
void SetClientVersion(int ver, const RString& b);
|
||||
void StartRequest(PacketFunctions &Packet);
|
||||
int GetData(PacketFunctions &Packet);
|
||||
GameClient();
|
||||
LanPlayer Player[2];
|
||||
bool IsPlaying(int Player);
|
||||
void StyleUpdate(PacketFunctions &Packet);
|
||||
bool InGame;
|
||||
int twoPlayers;
|
||||
bool hasSong;
|
||||
bool forceHas;
|
||||
bool inNetMusicSelect;
|
||||
int startPosition;
|
||||
bool isStarting;
|
||||
bool wasIngame;
|
||||
bool lowerJudge;
|
||||
|
||||
enum LastNetScreen
|
||||
{
|
||||
NS_NOWHERE = 0,
|
||||
NS_SELECTSCREEN,
|
||||
NS_OPTIONS,
|
||||
NS_EVALUATION
|
||||
} NetScreenInfo;
|
||||
|
||||
private:
|
||||
string build;
|
||||
GameInfo gameInfo;
|
||||
int version;
|
||||
};
|
||||
#endif
|
||||
|
||||
class StepManiaLanServer
|
||||
{
|
||||
public:
|
||||
bool ServerStart();
|
||||
void ServerStop();
|
||||
void ServerUpdate();
|
||||
StepManiaLanServer();
|
||||
~StepManiaLanServer();
|
||||
RString servername;
|
||||
RString lastError;
|
||||
int lastErrorCode;
|
||||
|
||||
private:
|
||||
#if !defined(WITHOUT_NETWORKING)
|
||||
bool stop;
|
||||
PacketFunctions Packet;
|
||||
PacketFunctions Reply;
|
||||
vector<GameClient*> Client;
|
||||
EzSockets server;
|
||||
EzSockets broadcast;
|
||||
int ClientHost;
|
||||
vector<LanPlayer*> playersPtr;
|
||||
time_t statsTime;
|
||||
GameInfo CurrentSongInfo;
|
||||
GameInfo LastSongInfo;
|
||||
bool SecondSameSelect;
|
||||
vector<RString> bannedIPs;
|
||||
|
||||
void Hello(PacketFunctions& Packet, const unsigned int clientNum);
|
||||
void UpdateClients();
|
||||
void NewClientCheck();
|
||||
void ParseData(PacketFunctions& Packet, const unsigned int clientNum);
|
||||
void SendValue(uint8_t value, const unsigned int clientNum);
|
||||
void CheckReady();
|
||||
void MoveClientToHost();
|
||||
void StatsComboColumn(PacketFunctions &data, vector<LanPlayer*> &playresPtr);
|
||||
void SendStatsToClients();
|
||||
void StatsProjgradeColumn(PacketFunctions& data, vector<LanPlayer*> &playresPtr);
|
||||
void StatsNameColumn(PacketFunctions& data, vector<LanPlayer*> &playresPtr);
|
||||
void SendNetPacket(const unsigned int clientNum, PacketFunctions &Packet);
|
||||
int SortStats(vector<LanPlayer*> &playresPtr);
|
||||
void RelayChat(RString &passedmessage, const unsigned int clientNum);
|
||||
void SelectSong(PacketFunctions& Packet, const unsigned int clientNum);
|
||||
void ServerChat(const RString& message);
|
||||
void SendToAllClients(PacketFunctions& Packet);
|
||||
bool CheckHasSongState();
|
||||
void ClearHasSong();
|
||||
void AssignPlayerIDs();
|
||||
void SendUserList();
|
||||
void GameOver(PacketFunctions& Packet, const unsigned int clientNum);
|
||||
void ScreenNetMusicSelectStatus(PacketFunctions& Packet, const unsigned int clientNum);
|
||||
void AnalizeChat(PacketFunctions &Packet, const unsigned int clientNum);
|
||||
RString ListPlayers();
|
||||
void Kick(RString &name);
|
||||
void Ban(RString &name);
|
||||
bool IsBanned(RString &ip);
|
||||
void ForceStart();
|
||||
void CheckLowerJudge(const unsigned int clientNum);
|
||||
bool CheckConnection(const unsigned int clientNum);
|
||||
void PopulatePlayersPtr(vector<LanPlayer*> &playersPtr);
|
||||
void Disconnect(const unsigned int clientNum);
|
||||
void ClientsSongSelectStart();
|
||||
void ResetLastSongInfo();
|
||||
void BroadcastInfo();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) 2003-2004 Joshua Allen
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
@@ -16,34 +16,21 @@
|
||||
|
||||
static LocalizedString CLIENT_CONNECT ( "ScreenNetworkOptions", "Connect" );
|
||||
static LocalizedString CLIENT_DISCONNECT ( "ScreenNetworkOptions", "Disconnect" );
|
||||
static LocalizedString SERVER_START ( "ScreenNetworkOptions", "Start" );
|
||||
static LocalizedString SERVER_STOP ( "ScreenNetworkOptions", "Stop" );
|
||||
static LocalizedString SCORE_ON ( "ScreenNetworkOptions", "ScoreOn" );
|
||||
static LocalizedString SCORE_OFF ( "ScreenNetworkOptions", "ScoreOff" );
|
||||
static LocalizedString SERVER_STARTED ( "ScreenNetworkOptions", "Server started." );
|
||||
static LocalizedString SERVER_FAILED ( "ScreenNetworkOptions", "Server failed: %s Code:%d" );
|
||||
|
||||
static LocalizedString DISCONNECTED ( "ScreenNetworkOptions", "Disconnected from server." );
|
||||
static LocalizedString SERVER_STOPPED ( "ScreenNetworkOptions", "Server stopped." );
|
||||
static LocalizedString ENTER_NETWORK_ADDRESS ( "ScreenNetworkOptions", "Enter a network address." );
|
||||
static LocalizedString CONNECT_TO_YOURSELF ( "ScreenNetworkOptions", "Use 127.0.0.1 to connect to yourself." );
|
||||
static LocalizedString ENTER_A_SERVER_NAME ( "ScreenNetworkOptions", "Enter a server name." );
|
||||
|
||||
enum
|
||||
{
|
||||
PO_CONNECTION,
|
||||
PO_SERVER,
|
||||
PO_SCOREBOARD,
|
||||
PO_SERVERS,
|
||||
NUM_NETWORK_OPTIONS_LINES
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NO_STOP_SERVER=0,
|
||||
NO_START_SERVER
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NO_SCOREBOARD_OFF=0,
|
||||
@@ -51,7 +38,6 @@ enum
|
||||
};
|
||||
|
||||
AutoScreenMessage( SM_DoneConnecting )
|
||||
AutoScreenMessage( SM_ServerNameEnter )
|
||||
|
||||
Preference<RString> g_sLastServer( "LastConnectedServer", "" );
|
||||
|
||||
@@ -72,15 +58,6 @@ void ScreenNetworkOptions::Init()
|
||||
else
|
||||
pHand->m_Def.m_vsChoices.push_back(CLIENT_CONNECT);
|
||||
}
|
||||
{
|
||||
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
|
||||
vHands.push_back( pHand );
|
||||
pHand->m_Def.m_bAllowThemeItems = false;
|
||||
pHand->m_Def.m_bOneChoiceForAllPlayers = true;
|
||||
pHand->m_Def.m_sName = "Server";
|
||||
pHand->m_Def.m_vsChoices.push_back(SERVER_STOP);
|
||||
pHand->m_Def.m_vsChoices.push_back(SERVER_START);
|
||||
}
|
||||
{
|
||||
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
|
||||
vHands.push_back( pHand );
|
||||
@@ -123,24 +100,6 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
g_sLastServer.Set( ScreenTextEntry::s_sLastAnswer );
|
||||
}
|
||||
}
|
||||
else if( SM == SM_ServerNameEnter )
|
||||
{
|
||||
if( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
if ( NSMAN->LANserver == NULL)
|
||||
NSMAN->LANserver = new StepManiaLanServer;
|
||||
NSMAN->LANserver->servername = ScreenTextEntry::s_sLastAnswer;
|
||||
if (NSMAN->LANserver->ServerStart())
|
||||
{
|
||||
NSMAN->isLanServer = true;
|
||||
SCREENMAN->SystemMessage( SERVER_STARTED );
|
||||
}
|
||||
else
|
||||
{
|
||||
SCREENMAN->SystemMessage( ssprintf(SERVER_FAILED.GetValue(),NSMAN->LANserver->lastError.c_str(),NSMAN->LANserver->lastErrorCode) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScreenOptions::HandleScreenMessage( SM );
|
||||
}
|
||||
@@ -161,23 +120,6 @@ void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
|
||||
UpdateConnectStatus( );
|
||||
}
|
||||
break;
|
||||
case PO_SERVER:
|
||||
switch( m_pRows[GetCurrentRow()]->GetOneSharedSelection() )
|
||||
{
|
||||
case NO_START_SERVER:
|
||||
if (!NSMAN->isLanServer)
|
||||
{
|
||||
ScreenTextEntry::TextEntry( SM_ServerNameEnter, ENTER_A_SERVER_NAME, "", 128);
|
||||
}
|
||||
break;
|
||||
case NO_STOP_SERVER:
|
||||
if ( NSMAN->LANserver != NULL )
|
||||
NSMAN->LANserver->ServerStop();
|
||||
SCREENMAN->SystemMessage( SERVER_STOPPED );
|
||||
NSMAN->isLanServer = false;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PO_SCOREBOARD:
|
||||
if (m_pRows[PO_SCOREBOARD]->GetOneSharedSelection() == NO_SCOREBOARD_ON)
|
||||
PREFSMAN->m_bEnableScoreboard.Set(true);
|
||||
|
||||
@@ -4786,14 +4786,6 @@
|
||||
RelativePath="NetworkSyncManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NetworkSyncServer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NetworkSyncServer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NoteSkinManager.cpp"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user