Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Communicating (SubGame <-> Biller)

 
Post new topic   Reply to topic Printable version
 View previous topic  Zone pinger Post :: Post CLC -> Smaller LVZ  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sun Jul 01, 2007 9:46 pm    Post subject: Communicating (SubGame <-> Biller) Reply to topic Reply with quote

I'm trying to extend UBill to support subgame. I am able to send/receive datagrams. I don't know what to send or what to expect to receive. I am currently converting the biller to C and I plan on adding datagram for subgame on java as well.

When I receive a datagram it shows up as K??? where ? = the charcter used to display an unknown character.

I used an example from a website to get me started with C. I can see subgame is connecting. I have no idea what to send and what to expect to get to/from subgame.

This is the example I am using.
Code: Show/Hide

/* Creates a datagram server.  The port
   number is passed as an argument.  This
   server runs forever */

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>

void error(char *msg)
{
    perror(msg);
    exit(0);
}

int main(int argc, char *argv[])
{
   int sock, length, fromlen, n;
   struct sockaddr_in server;
   struct sockaddr_in from;
   char buf[1024];

   if (argc < 2) {
      fprintf(stderr, "ERROR, no port provided\n");
      exit(0);
   }
   
   sock=socket(AF_INET, SOCK_DGRAM, 0);
   if (sock < 0) error("Opening socket");
   length = sizeof(server);
   bzero(&server,length);
   server.sin_family=AF_INET;
   server.sin_addr.s_addr=INADDR_ANY;
   server.sin_port=htons(atoi(argv[1]));
   if (bind(sock,(struct sockaddr *)&server,length)<0)
       error("binding");
   fromlen = sizeof(struct sockaddr_in);
   while (1) {
       n = recvfrom(sock,buf,1024,0,(struct sockaddr *)&from,&fromlen);
       if (n < 0) error("recvfrom");
       write(1,"Received a datagram: ",21);
       write(1,buf,n);
       n = sendto(sock,"Got your message\n",17,
                  0,(struct sockaddr *)&from,fromlen);
       if (n  < 0) error("sendto");
   }
}
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sun Jul 01, 2007 9:52 pm    Post subject: Reply to topic Reply with quote

The VIE biller protocol hasn't been documented by anyone, I pretty much "reverse engineered" based on Catid's biller, ASSS's source code, and packet logging between subgame and subbill.
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sun Jul 01, 2007 10:20 pm    Post subject: Reply to topic Reply with quote

I don't know how I'm going to do this if that is the case. Thanks for replying.
Anyone feel like showing the subgame equivalent of the asss billing protocol.
Like... CONNECT = w/e and CONNECTOK = w/e
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Mon Jul 02, 2007 7:13 am    Post subject: Reply to topic Reply with quote

Well, it uses the VIE core protocol, the first packet you should receive from Subgame would look like
00 01 RR RR RR RR 00 01

Where those numbers are hex values, and RR is a byte of a 4-byte little endian integer.

You can read more about the VIE protocol here:
http://mervbot.com/files/addendum.txt
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Mon Jul 02, 2007 12:13 pm    Post subject: Reply to topic Reply with quote

I am still completely clueless. icon_mad.gif

Subgame only sends me stuff like this.


I don't understand how to send those 01 02 RR RR KK VV things. ASSS always sent plain text. This is all new to me. How do I send and decode things sent from subgame?

icon_redface.gif




Screenshot-1.png - 44.71 KB
File downloaded or viewed 33 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Jul 02, 2007 1:09 pm    Post subject: Reply to topic Reply with quote

It's not plaintext, it's binary data.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Tue Jul 03, 2007 5:34 am    Post subject: Reply to topic Reply with quote

You will struggle with processing the binary data in java, as java uses big-endian and subgame uses small endian.

The TCP-Billing protocol is an order of magnitude simpler (it was designed to be simpler) than the VIE-billing protocol. It is also very much "c" orientrated, it is based on "stucts" To use it (in c) you need to create a struct of each data packet. then cast the received packet into the correct struct. however some datapackets can contain other packets inside them.

There is a good helper java class in twcore for processing subgame binary data. You may wish to look at the code for my semi-working dir-server (uses core protocal) http://forums.minegoboom.com/viewtopic.php?t=7149
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Misc User Apps All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 679 page(s) served in previous 5 minutes.

phpBB Created this page in 0.626233 seconds : 34 queries executed (79.6%): GZIP compression disabled