Áƒ*žEˆˆ¨[EfD‰¸pG>ŽÓ¹gZ—øö ¨¨€¨¨‚¨ƒ¨„¨…¨†¨‡¨ˆNone UdpBeaconEngineCoreSystem SendTextIpDrvBroadcastBeacon ReceivedText BindPort ReadBinaryReceivedBinaryIpAddrToStringUdpLink ReadText ReceivedLineGetAddressURL Destroyed BeginPlay bAlwaysTickGetBeaconTextBroadcastBeaconQuery SendBinaryTimer RemoteRole MODE_Text ParseURLClosedOpened Accepted IsConnected RMODE_EventSTATE_ConnectClosingSTATE_ListenClosingSTATE_ConnectClosePendingSTATE_ListenClosePendingSTATE_ConnectedSTATE_ConnectingSTATE_Listening RMODE_Manual STATE_ReadyBeaconTimeout BeaconPortBeaconProductBroadcastAddrGetBeaconAddressResolveFailed Resolved GetLocalIPStringToIpAddrOpenClose Validate MODE_Line MODE_Binary InternetLinkTcpLinkClientBeaconReceiver GetLastErrorIpAddrIsDataPendingSTATE_InitializedResolveListen BeaconInfoServerBeaconPort DoBeacon ELinkModePrivateResolveInfoEnumStructPortAddrURL FunctionObjectLineCount EntryNameStrDomain RemoteSocket StrPropertyArg TextBufferValidationString TimeSecondsSocket LinkModeNStructPropertybUseNextAvailableArrayPropertyClassPropertyObjectPropertyFloatProperty BoolPropertyGame GameName DataPending EReceiveModePackageUdpServerQueryPort boundport IntProperty BytePropertyTextBeacons ELinkStateji ReturnValueBTime ScriptTextClass ReceiveMode LevelInfo LinkState RemoteAddr AcceptClass SendFIFO GameInfo InternetInfoLevelActor LevelNameNoneNoneNoneNoneNoneNoneNoneNoneNoneG;G GG3 @G3GGGGG€@GGGG GG.@D{b7ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ñlw8®¿<.ŒGGGGGGGG€GGGG@GG v4ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ™N56…ŠŽ”ŠŽ”ŠŽ”š©Ù«ŒBÓA"I"*"1&)$ @+]unrealGGGG€@GG@G€GGGG+@ uQ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ6… Ñlw8Œ,"ÿÿÿÿÓG zf8ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2ç! Ñlw8ŒÓGGr'G€@GGW€@GG56G €@GG"€@GG€@GG€GGLe%† G—] {p 'Cš%çUdpBeacon failed to bind a port. 6 6   G]€GG=€GGS€@GG)€@GGK€GG$A#žVA¨¨ ’~:&œ G @G-€@GGE€@GGGG^ÿ€GG€GG/€GGp€GG@G‘98Ø‘ GZ€@GG7GG_GGm€GG#`/HAzREPORT?zREPORTQUERY G;€GG[€@GG€GGWÿ€GG?€GG@€GGVÿ€GG€GGL€GGD€GGM€@GGGGG =(&%$#"! GH€GGI€GGNÿ€GGEGG€GGSG £)G)H)IG€GG€GGa:' ):);G~f/Ww  GYR +Ÿ Go€GGXC& )C)DGÿ€GGxZ:EùG€GG€GGO>)>)?)@GU<Ú)) )"))G€GG€GGR(1K½ )())G€@GG\,4N^ ),)-G€GG*<)’<¨ S. G6 ” )6)7GP.Zº  GGGcGGV€GG€GGdGGgGGhGGiGG˜8-¿ 68 G€@GG€@GG™k262 GT€GG€@GG$nf¤C— '%a€?'çClientBeaconReceiver initialized.wçClientBeaconReceiver failed: Beacon port in use.66  GjGG4q.¥$çClientBeaconReceiver finished. G›s4ü·%}–, s‚›66%(°¯’6+¥¥µ–, 66%¥ˆ Ge//============================================================================= // UdpLink: An Internet UDP connectionless socket. //============================================================================= class UdpLink extends InternetLink native transient; //----------------------------------------------------------------------------- // Variables. var() const int BroadcastAddr; //----------------------------------------------------------------------------- // Natives. // BindPort: Binds a free port or optional port specified in argument one. native function int BindPort( optional int Port, optional bool bUseNextAvailable ); // SendText: Sends text string. // Appends a cr/lf if LinkMode=MODE_Line . native function bool SendText( IpAddr Addr, coerce string Str ); // SendBinary: Send data as a byte array. native function bool SendBinary( IpAddr Addr, int Count, byte B[255] ); // ReadText: Reads text string. // Returns number of bytes read. native function int ReadText( out IpAddr Addr, out string Str ); // ReadBinary: Read data as a byte array. native function int ReadBinary( out IpAddr Addr, int Count, out byte B[255] ); //----------------------------------------------------------------------------- // Events. // ReceivedText: Called when data is received and connection mode is MODE_Text. event ReceivedText( IpAddr Addr, string Text ); // ReceivedLine: Called when data is received and connection mode is MODE_Line. event ReceivedLine( IpAddr Addr, string Line ); // ReceivedBinary: Called when data is received and connection mode is MODE_Binary. event ReceivedBinary( IpAddr Addr, int Count, byte B[255] ); GU//============================================================================= // UdpBeacon: Base class of beacon sender and receiver. //============================================================================= class UdpBeacon extends UdpLink config transient; var() globalconfig bool DoBeacon; var() globalconfig int ServerBeaconPort; // Listen port var() globalconfig int BeaconPort; // Reply port var() globalconfig float BeaconTimeout; var() globalconfig string BeaconProduct; var int UdpServerQueryPort; var int boundport; function BeginPlay() { local IpAddr Addr; boundport = BindPort(ServerBeaconPort, True); if ( boundport == 0 ) { log( "UdpBeacon failed to bind a port." ); return; } Addr.Addr = BroadcastAddr; Addr.Port = BeaconPort; BroadcastBeacon(Addr); // Initial notification. } function BroadcastBeacon(IpAddr Addr) { SendText( Addr, BeaconProduct @ Mid(Level.GetAddressURL(),InStr(Level.GetAddressURL(),":")+1) @ Level.Game.GetBeaconText() ); //Log( "UdpBeacon: sending reply to "$IpAddrToString(Addr) ); } function BroadcastBeaconQuery(IpAddr Addr) { SendText( Addr, BeaconProduct @ UdpServerQueryPort ); //Log( "UdpBeacon: sending query reply to "$IpAddrToString(Addr) ); } event ReceivedText( IpAddr Addr, string Text ) { if( Text == "REPORT" ) BroadcastBeacon(Addr); if( Text == "REPORTQUERY" ) BroadcastBeaconQuery(Addr); } function Destroyed() { Super.Destroyed(); //Log("ServerBeacon Destroyed"); } G*tK?KREPORT GY!>B«)!G9wF~? } =|€’ &p  ’ &6 J%Ž–, „26Ž¥XÕš, %Õ–, Ëš66%Õ¥¡ãš,  66’6’~ & Gp3//============================================================================= // TcpLink: An Internet TCP/IP connection. //============================================================================= class TcpLink extends InternetLink native transient; //----------------------------------------------------------------------------- // Variables. // LinkState is only valid for TcpLink at this time. var enum ELinkState { STATE_Initialized, // Sockets is initialized STATE_Ready, // Port bound, ready for activity STATE_Listening, // Listening for connections STATE_Connecting, // Attempting to connect STATE_Connected, // Open and connected STATE_ListenClosePending,// Socket in process of closing STATE_ConnectClosePending,// Socket in process of closing STATE_ListenClosing, // Socket in process of closing STATE_ConnectClosing // Socket in process of closing } LinkState; var IpAddr RemoteAddr; // Contains address of peer connected to from a Listen() // If AcceptClass is not None, an actor of class AcceptClass will be spawned when an // incoming connecting is accepted, leaving the listener open to accept more connections. // Accepted() is called only in the child class. You can use the LostChild() and GainedChild() // events to track your children. var class AcceptClass; var const Array SendFIFO; // send fifo //----------------------------------------------------------------------------- // natives. // BindPort: Binds a free port or optional port specified in argument one. native function int BindPort( optional int Port, optional bool bUseNextAvailable ); // Listen: Listen for connections. Can handle up to 5 simultaneous connections. // Returns false if failed to place socket in listen mode. native function bool Listen(); // Open: Open a connection to a foreign host. native function bool Open( IpAddr Addr ); // Close: Closes the current connection. native function bool Close(); // IsConnected: Returns true if connected. native function bool IsConnected(); // SendText: Sends text string. // Appends a cr/lf if LinkMode=MODE_Line. Returns number of bytes sent. native function int SendText( coerce string Str ); // SendBinary: Send data as a byte array. native function int SendBinary( int Count, byte B[255] ); // ReadText: Reads text string. // Returns number of bytes read. native function int ReadText( out string Str ); // ReadBinary: Read data as a byte array. native function int ReadBinary( int Count, out byte B[255] ); //----------------------------------------------------------------------------- // Events. // Accepted: Called during STATE_Listening when a new connection is accepted. event Accepted(); // Opened: Called when socket successfully connects. event Opened(); // Closed: Called when Close() completes or the connection is dropped. event Closed(); // ReceivedText: Called when data is received and connection mode is MODE_Text. event ReceivedText( string Text ); // ReceivedLine: Called when data is received and connection mode is MODE_Line. event ReceivedLine( string Line ); // ReceivedBinary: Called when data is received and connection mode is MODE_Binary. event ReceivedBinary( int Count, byte B[255] ); G@'//============================================================================= // InternetLink: Parent class for Internet connection classes //============================================================================= class InternetLink extends InternetInfo native transient; //----------------------------------------------------------------------------- // Types & Variables. // An IP address. struct IpAddr { var int Addr; var int Port; }; // Data receive mode. // Cannot be set in default properties. var enum ELinkMode { MODE_Text, MODE_Line, MODE_Binary } LinkMode; // Internal var const int Socket; var const int Port; var const int RemoteSocket; var private native const int PrivateResolveInfo; var const int DataPending; // Receive mode. // If mode is MODE_Manual, received events will not be called. // This means it is your responsibility to check the DataPending // var and receive the data. // Cannot be set in default properties. var enum EReceiveMode { RMODE_Manual, RMODE_Event } ReceiveMode; //----------------------------------------------------------------------------- // Natives. // Returns true if data is pending on the socket. native function bool IsDataPending(); // Parses an Unreal URL into its component elements. // Returns false if the URL was invalid. native function bool ParseURL ( coerce string URL, out string Addr, out int Port, out string LevelName, out string EntryName ); // Resolve a domain or dotted IP. // Nonblocking operation. // Triggers Resolved event if successful. // Triggers ResolveFailed event if unsuccessful. native function Resolve( coerce string Domain ); // Returns most recent winsock error. native function int GetLastError(); // Convert an IP address to a string. native function string IpAddrToString( IpAddr Arg ); // Convert a string to an IP native function bool StringToIpAddr( string Str, out IpAddr Addr ); // Validate: Takes a challenge string and returns an encoded validation string. native function string Validate( string ValidationString, string GameName ); native function GetLocalIP(out IpAddr Arg ); //----------------------------------------------------------------------------- // Events. // Called when domain resolution is successful. // The IpAddr struct Addr contains the valid address. event Resolved( IpAddr Addr ); // Called when domain resolution fails. event ResolveFailed(); GG//============================================================================= // ClientBeaconReceiver: Receives LAN beacons from servers. //============================================================================= class ClientBeaconReceiver extends UdpBeacon transient; var struct BeaconInfo { var IpAddr Addr; var float Time; var string Text; } Beacons[32]; function string GetBeaconAddress( int i ) { return IpAddrToString(Beacons[i].Addr); } function string GetBeaconText(int i) { return Beacons[i].Text; } function BeginPlay() { local IpAddr Addr; if( BindPort( BeaconPort, true ) > 0 ) { SetTimer( 1.0, true ); log( "ClientBeaconReceiver initialized." ); } else { log( "ClientBeaconReceiver failed: Beacon port in use." ); } Addr.Addr = BroadcastAddr; Addr.Port = ServerBeaconPort; BroadcastBeacon(Addr); } function Destroyed() { log( "ClientBeaconReceiver finished." ); } function Timer() { local int i, j; for( i=0; iƒLoc>‚q>‚ /P?‚ n?…QHL@‚"\@ˆQp~@‚ :MA‡XoiA‡YowA‚"EB‚ %gBƒUoLC‡OoZC‚ 1hC„’oGD‚ 4UDƒaotD‚(BE‚ jE‚ .HFˆ teFƒ ctF…#HCG…PHSGƒ DbGƒ QqGƒ G@Hƒ WOH‚˜}-'^H„™LEI„koSI‚™}%aIƒQMFJ„noUJ‚$}acJˆ XDM‚4}?TM‚›}GSNŽr4qZPŽr4aKk‚*},lƒ‚ >X„‚9}\u„Žr4|3QˆŽ r4L'M¼Ž}r4SYã9kl‚ 0Wƒˆvtƒ…wE„•xU„–yf„ˆ‚yw„‚ "F…„^oh…‡•ov…ƒ„oD†‚?R†‡ˆon†‚2|†‡\o[‡‡Šoi‡‚3w‡‡oSˆ‚aˆ‡o}ˆ‚K‰‚ h‰ƒ‘oEŠ‚SŠ‚ <rŠ„#jM‹ƒ”o[‹‚i‹‚FŒƒ˜ocŒ‚ qŒ…™HP‡B `ƒ›om‚{‚XŽ‚uŽ‚R„¢jp‚~„¤L\‚ jƒ¦MH‘ˆ¦pW‘