コード例 #1
0
void StepManiaLanServer::ParseData(PacketFunctions& Packet, const unsigned int clientNum)
{
	int command = Packet.Read1();
	switch (command)
	{
	case NSCPing:
		// No Operation
		SendValue(NSServerOffset + NSCPingR, clientNum);
		break;
	case NSCPingR:
		// No Operation response
		break;
	case NSCHello:
		// Hello
		Hello(Packet, clientNum);
		break;
	case NSCGSR:
		// Start Request
		Client[clientNum]->StartRequest(Packet);
		CheckReady();  //This is what ACTUALLY starts the games
		break;
	case NSCGON:
		// GameOver 
		GameOver(Packet, clientNum);
		break;
	case NSCGSU:
		// StatsUpdate
		Client[clientNum]->UpdateStats(Packet);
		if (!Client[clientNum]->lowerJudge)
			CheckLowerJudge(clientNum);
		break;
	case NSCSU:
		// Style Update
		Client[clientNum]->StyleUpdate(Packet);
		SendUserList();
		break;
	case NSCCM:
		// Chat message
		AnalizeChat(Packet, clientNum);
		break;
	case NSCRSG:
		SelectSong(Packet, clientNum);
		break;
	case NSCSMS:
		ScreenNetMusicSelectStatus(Packet, clientNum);
		break;
	case NSCUPOpts:
		Client[clientNum]->Player[0].options = Packet.ReadNT();		
		Client[clientNum]->Player[1].options = Packet.ReadNT();		
		break;
	default:
		break;
	}
}	 
コード例 #2
0
ファイル: SMOnlineRoom.cpp プロジェクト: freem/SMOnline-v1
void SMOnlineRoom::ParseData(PacketFunctions& Packet, int clientnum)
{
    /* Try not to do any Packet Parsing here here because a lot of parsing
    was done in the Client. Parsing again would be a waste.
    Packet has been unaltered previous to this point.*/
    int command = Packet.Read1();
    switch (command)
    {
    case NSCPing:
        // No Operation
//		SendValue(NSServerOffset + NSCPingR, clientNum);
        break;
    case NSCPingR:
        // No Operation response
        break;
    case NSCHello:
        // Hello
        break;
    case NSCSU:
        // Style Update
        break;
    case NSCCM:
        // Chat message
        AnalizeChat(clientnum, Packet);
        break;
    case NSCSMS:
        //Room Status Change
        SendRoomTitle(clientnum);
        SendRoomList(clientnum);
        break;
    case NSSMONL:
        SMOnlineParse(Packet, clientnum);
        break;
    default:
        break;
    }
}