class SchlonzUdpLink extends UdpLink; var IpAddr destination; var LevelInfo LevelInf; var SchlonzVotingPage VotPage; function bindNextAvail() { BindPort( 1025, true ); } // bindNextAvail function setIP( int ip ) { destination.Addr = ip; } // setIP function setPort( int port ) { destination.Port = port; } // setPort function setIpPortInt( int ip, int port ) { destination.Addr = ip; destination.Port = port; } // setIpPortInt function setIpPort( string StrIp, int port ) { log( StrIp ); StringToIpAddr( StrIp, destination ); log( destination.Addr ); destination.Port = port; } // setIpPort function NextLevel( LevelInfo L, string LastMap ) { LevelInf = L; LinkMode = MODE_Text; ReceiveMode = RMODE_Event; SendText( destination, "NextLevel:" $ LastMap ); } //NextLevel function CycleLevel( LevelInfo L, string LastMap ) { LevelInf = L; LinkMode = MODE_Text; ReceiveMode = RMODE_Event; SendText( destination, "CycleLevel:" $ LastMap ); } // CycleLevel function GetVote( SchlonzVotingPage vp ) { VotPage = vp; LinkMode = MODE_Text; ReceiveMode = RMODE_Event; SendText( destination, "GetVote" ); } // GetVote event ReceivedText( IpAddr Addr, string Text ) { log( Text ); if( Mid( Text, 0, 5 ) == "Vote:" ) { // actual voting // 5 10 13 16 19 22 25 // Vote:xxxx|xx|xx|xx|xx|xx|xx log( "Write log to screen:" $ Text ); VotPage.l_votecnt.Caption = "Vote Count: " $ Mid( Text,10, 2) $ " Score:" $ Mid( Text, 5, 4 ); VotPage.l_quali.Caption = Mid( Text, 13, 2); VotPage.l_size.Caption = Mid( Text, 16, 2); VotPage.l_terrain.Caption = Mid( Text, 19, 2); VotPage.l_deco.Caption = Mid( Text, 22, 2); VotPage.l_bots.Caption = Mid( Text, 25, 2); //VotPage.co_ed_general.SetText( Text ); } else { // change level log( "ServerTravel" ); LevelInf.ServerTravel(Text, false); // change the map } } // ReceivedText function sText( string str ) { SendText( destination, str ); } defaultproperties { }