Possible? Make a Chivlary server communicate with a website?

  • Does anyone know if this would be possible…

    With SdK or otherwise,

    To transmit the results of a duel server to a website, Ie, who vs. who and which player won.

    Not asking how to do it, though any info would be great, just wondering first if its even possible, and any info regarding how to go abouts figuring out how to do this would be amazing.

  • Yes, it’s possible.

    For performance reasons you likely want to subclass TcpLink, connect your webserver to UDK, and send any data from server to webserver compressed and using opcodes.
    If the data you are sending is small enough, you don’t need to waste cpu time compressing it though.

  • Wicked, thanks man!

  • I must warn you that UnrealScript is not a general-purpose language and you can’t write native C++ code yourself, so a lot of stuff will be missing.
    For instance, if you intend to compress your data, you want to create a DLL with wrappers for zlib’s compress/uncompress functions, then have your class declared with DLLBind(MyDLL) and any subsequent methods (DLL wrappers) declared with the dllimport modifier.
    More information can be found here http://udn.epicgames.com/Three/DLLBind.html.

    I would recommend using the following format for your stream:

    [int8_t/char compressed][uint16_t/unsigned short data_size]<[uint16_t/unsigned short opcode][unsigned char *data]>

    compressed should be a single byte only:

    0: data is not compressed and should not be uncompressed.
    1: data is compressed and should be uncompressed before reading.

    data_size is the number of bytes that should be read from the stream starting on the current offset.
    It must be the size of compressed/uncompressed opcode + data.

    You want to compress opcode + data if their combined size is too big, this will save you some bandwidth. If bandwidth is not a problem, then don’t waste your or your CPU’s time.

    I don’t know how you intend to do it, but you also must be aware that the TcpLink class isn’t a direct operation with sockets.
    You won’t have as much freedom as you would when dealing with C/C++ sockets.
    TcpLink is a very high level and simplified class in UDK.
    You can however, open connections, listen, and even create new instances for each connection that is accepted on UDK.

    If you intend to have your website display information from say, a SQL database, have UDK establish connection and send data to a “middleman” application, and from there you can do all the database querying and writting without putting more stress into the game server.

Log in to reply