Changed portions of the code to use enum NSCommand
This commit is contained in:
@@ -82,8 +82,8 @@ void StepManiaLanServer::ServerUpdate()
|
|||||||
|
|
||||||
void StepManiaLanServer::UpdateClients()
|
void StepManiaLanServer::UpdateClients()
|
||||||
{
|
{
|
||||||
/* Go through all the clients and check to see if it is being used.
|
//Go through all the clients and check to see if it is being used.
|
||||||
If so then try to get a backet and parse the data. */
|
//If so then try to get a backet and parse the data.
|
||||||
for (int x = 0; x < NUMBERCLIENTS; x++)
|
for (int x = 0; x < NUMBERCLIENTS; x++)
|
||||||
if (Client[x].Used == 1)
|
if (Client[x].Used == 1)
|
||||||
if (Client[x].GetData(Packet) >= 0)
|
if (Client[x].GetData(Packet) >= 0)
|
||||||
@@ -266,7 +266,7 @@ void StepManiaLanServer::CheckReady()
|
|||||||
if (Client[x].isStarting)
|
if (Client[x].isStarting)
|
||||||
{
|
{
|
||||||
Client[x].clientSocket.blocking = true;
|
Client[x].clientSocket.blocking = true;
|
||||||
SendValue(131, x);
|
SendValue(NSCGSR + NSServerOffset, x);
|
||||||
Client[x].GotStartRequest = false;
|
Client[x].GotStartRequest = false;
|
||||||
if (Client[x].startPosition == 1)
|
if (Client[x].startPosition == 1)
|
||||||
{
|
{
|
||||||
@@ -301,7 +301,7 @@ void StepManiaLanServer::GameOver(PacketFunctions& Packet, int clientNum)
|
|||||||
{
|
{
|
||||||
numPlayers = SortStats(playersPtr);
|
numPlayers = SortStats(playersPtr);
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1( 4+128 );
|
Reply.Write1( NSCGON + NSServerOffset );
|
||||||
Reply.Write1( (uint8_t) numPlayers );
|
Reply.Write1( (uint8_t) numPlayers );
|
||||||
for (x = 0; x < numPlayers; ++x)
|
for (x = 0; x < numPlayers; ++x)
|
||||||
Reply.Write1((uint8_t)playersPtr[x]->PlayerID);
|
Reply.Write1((uint8_t)playersPtr[x]->PlayerID);
|
||||||
@@ -394,7 +394,7 @@ void StepManiaLanServer::SendStatsToClients()
|
|||||||
{
|
{
|
||||||
/* Write and Send name packet */
|
/* Write and Send name packet */
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1(133);
|
Reply.Write1(NSCGSU + NSServerOffset);
|
||||||
Reply.Write1(0);
|
Reply.Write1(0);
|
||||||
Reply.Write1( (uint8_t) numPlayers );
|
Reply.Write1( (uint8_t) numPlayers );
|
||||||
StatsNameColumn(Reply, playersPtr, numPlayers);
|
StatsNameColumn(Reply, playersPtr, numPlayers);
|
||||||
@@ -409,7 +409,7 @@ void StepManiaLanServer::SendStatsToClients()
|
|||||||
/* Write and send Combo packet */
|
/* Write and send Combo packet */
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
|
|
||||||
Reply.Write1(133);
|
Reply.Write1(NSCGSU + NSServerOffset);
|
||||||
Reply.Write1(1);
|
Reply.Write1(1);
|
||||||
Reply.Write1( (uint8_t) numPlayers );
|
Reply.Write1( (uint8_t) numPlayers );
|
||||||
StatsComboColumn(Reply, playersPtr, numPlayers);
|
StatsComboColumn(Reply, playersPtr, numPlayers);
|
||||||
@@ -425,7 +425,7 @@ void StepManiaLanServer::SendStatsToClients()
|
|||||||
//Probably not. Sends all everytime unless developer feelings change.
|
//Probably not. Sends all everytime unless developer feelings change.
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
|
|
||||||
Reply.Write1(133);
|
Reply.Write1(NSCGSU + NSServerOffset);
|
||||||
Reply.Write1(2);
|
Reply.Write1(2);
|
||||||
Reply.Write1( (uint8_t) numPlayers );
|
Reply.Write1( (uint8_t) numPlayers );
|
||||||
StatsProjgradeColumn(Reply, playersPtr, numPlayers);
|
StatsProjgradeColumn(Reply, playersPtr, numPlayers);
|
||||||
@@ -524,7 +524,7 @@ void StepManiaLanServer::RelayChat(PacketFunctions& Packet, int clientNum)
|
|||||||
|
|
||||||
message += ": ";
|
message += ": ";
|
||||||
message += Packet.ReadNT();
|
message += Packet.ReadNT();
|
||||||
Reply.Write1(135);
|
Reply.Write1(NSCCM + NSServerOffset);
|
||||||
Reply.WriteNT(message);
|
Reply.WriteNT(message);
|
||||||
|
|
||||||
//Send to all clients
|
//Send to all clients
|
||||||
@@ -547,7 +547,7 @@ void StepManiaLanServer::SelectSong(PacketFunctions& Packet, int clientNum)
|
|||||||
CurrentSongInfo.subtitle = Packet.ReadNT();
|
CurrentSongInfo.subtitle = Packet.ReadNT();
|
||||||
|
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1(136);
|
Reply.Write1(NSCRSG + NSServerOffset);
|
||||||
Reply.Write1(1);
|
Reply.Write1(1);
|
||||||
Reply.WriteNT(CurrentSongInfo.title);
|
Reply.WriteNT(CurrentSongInfo.title);
|
||||||
Reply.WriteNT(CurrentSongInfo.artist);
|
Reply.WriteNT(CurrentSongInfo.artist);
|
||||||
@@ -583,7 +583,7 @@ void StepManiaLanServer::SelectSong(PacketFunctions& Packet, int clientNum)
|
|||||||
message = servername;
|
message = servername;
|
||||||
message += ": You do not have permission to pick a song.";
|
message += ": You do not have permission to pick a song.";
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1(135);
|
Reply.Write1(NSCCM + NSServerOffset);
|
||||||
Reply.WriteNT(message);
|
Reply.WriteNT(message);
|
||||||
SendNetPacket(clientNum, Reply);
|
SendNetPacket(clientNum, Reply);
|
||||||
}
|
}
|
||||||
@@ -617,7 +617,7 @@ void StepManiaLanServer::SelectSong(PacketFunctions& Packet, int clientNum)
|
|||||||
if ( CheckHasSongState() && SecondSameSelect && (clientNum == 0) )
|
if ( CheckHasSongState() && SecondSameSelect && (clientNum == 0) )
|
||||||
{
|
{
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1(136);
|
Reply.Write1(NSCRSG + NSServerOffset);
|
||||||
Reply.Write1(2);
|
Reply.Write1(2);
|
||||||
Reply.WriteNT(CurrentSongInfo.title);
|
Reply.WriteNT(CurrentSongInfo.title);
|
||||||
Reply.WriteNT(CurrentSongInfo.artist);
|
Reply.WriteNT(CurrentSongInfo.artist);
|
||||||
@@ -670,7 +670,7 @@ void StepManiaLanServer::SendToAllClients(PacketFunctions& Packet)
|
|||||||
void StepManiaLanServer::ServerChat(const CString& message)
|
void StepManiaLanServer::ServerChat(const CString& message)
|
||||||
{
|
{
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1(135);
|
Reply.Write1(NSCCM + NSServerOffset);
|
||||||
Reply.WriteNT(message);
|
Reply.WriteNT(message);
|
||||||
SendToAllClients(Reply);
|
SendToAllClients(Reply);
|
||||||
}
|
}
|
||||||
@@ -710,7 +710,7 @@ void StepManiaLanServer::MoveClientToHost()
|
|||||||
void StepManiaLanServer::SendUserList()
|
void StepManiaLanServer::SendUserList()
|
||||||
{
|
{
|
||||||
Reply.ClearPacket();
|
Reply.ClearPacket();
|
||||||
Reply.Write1(137);
|
Reply.Write1(NSCUUL + NSServerOffset);
|
||||||
Reply.Write1(NUMBERCLIENTS*2);
|
Reply.Write1(NUMBERCLIENTS*2);
|
||||||
Reply.Write1(NUMBERCLIENTS*2);
|
Reply.Write1(NUMBERCLIENTS*2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user