[Wizard] Armies of Exigo

Gamer's Internet Tunnel, formerly Gamer's IPX Tunnel

Postby Carlos_Ed » Tue Apr 05, 2005 2:02 pm

Thank, you... but I managed to tackle this problem before refreshig this page and seeing your very quick answer (thank you very much for that.).

This is hot it's currently scripted:
Code: Select all
   setvar heading "Joining a Session"
   setvar subheading "Enter the correct info bellow."
   addline control "label||Enter the Session's Host Adress:"
   addline control "text1|hostaddr||4"
   addline control "label||Enter the port assigned to you by the host:"
   addline control "text1|hostport||6"
   addline control "label||(Ask the host for this info.)"
   showpage
   setvar hosts ""
   setvar hosts hostaddr
   appendstring hosts ":"
   appendstring hosts hostport
   appendstring hosts METH_UDP


If you have any sugestion on how to improve it, be my guest!... :)
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Ark » Tue Apr 05, 2005 2:06 pm

The line: setvar hosts ""
is really not needed, it won't do anything useful, since the nextline will always set hosts to something, even if it is "" again. hostaddr would be "" without showpage, or "" if the user left the box blank, it doesn't matter really.
Ark
Site Admin
 
Posts: 2108
Joined: Sat Sep 13, 2003 4:21 pm

Postby Carlos_Ed » Tue Apr 05, 2005 3:13 pm

... one more for you, Ark. With continued support like this, my script will be finised in no time! :)

Code: Select all
#The hosting session page
   setvar heading "Hosting a Session"
   setvar subheading "Please select if you are hosting or joining the game below."
   addline control "textm|clientlist|Enter the hostname or IP each other person provides, one per line:|8"
  addline control "label||Everyone Joining your Session must have their external hostnames or IPs listed here."
   showpage
   
   numlines numclients clientlist
   
   if numclients < 1
      cancel "There must be at least one client joining your game session!"
   endif
   
   setvar i 0
   setvar hostport 213
   setvar clientportlist ""
   
  while i < numhosts
      getline hostaddr clientlist i
      appendstring hostaddr ":"
      appendstring hostaddr hostport
      addline clientportlist hostaddr
      appendstring hostaddr METH_UDP
      addline hosts   hostaddr   
      math i i + 1
      math hostport hostport + 1
  endwhile
  addline control "textm||numclients|hostaddr.|8"
  showpage


That is my code for the Host Configuration part of the script. What I want it to do, is to have the user make a list like the "Generic TCP or UDP" wizard, and then to create the "hosts" variable from that. And finally display a list of the clients adresses and their ports. It seem that the "hosts" list isn't even being populated...
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Ark » Tue Apr 05, 2005 3:19 pm

Where is numhosts set? It defaults to 0 which means the while loop is basically skipped over.
Ark
Site Admin
 
Posts: 2108
Joined: Sat Sep 13, 2003 4:21 pm

Postby Carlos_Ed » Tue Apr 05, 2005 3:23 pm

F*****' BIG LOOOL!... :lol:

Got it... too much copy+paste. I corrected that, but it still doesn't work. Maybe "addline" doesn't work on an empty string?
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Ark » Tue Apr 05, 2005 3:39 pm

addline works on an empty string. The control variable is set to an empty string after each showpage command and I always just addline to it, why bother setvar'ing the first line if its already empty.
You should debug using a bunch of extra showpage's so you know whats going on. Do like:
Code: Select all
setvar control "textm|variable||8"
showpage

To check what the contents of a variable are, or just put a showpage someplace to see if that piece of code is even reached.
Ark
Site Admin
 
Posts: 2108
Joined: Sat Sep 13, 2003 4:21 pm

Postby Carlos_Ed » Tue Apr 05, 2005 3:58 pm

Thanks for the tips. It almost works now. GiT gets configured properly. But the wizard page where I display all the adresses and the ports that got assigned to each adress, doesn't diplay anything.

Each cycle I do this:

Code: Select all
      getline hostaddr clientlist i
      
      appendstring hostaddr ":"
      appendstring hostaddr hostport

      addline clientportlist hostaddr


it should add a line like: <ip ou domain name>:<port> , on each cycle to the "clientportlist" variable, right? ... So, how do I display it's contents on a Wizard Page?
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Carlos_Ed » Tue Apr 05, 2005 4:50 pm

YES! I GOT IT! :D

Here's how I did the hosting part from the Wizard:

Code: Select all
#The hosting session page
   setvar heading "Hosting a Session"
   setvar subheading "Please select if you are hosting or joining the game below."
   addline control "textm|clientlist|Enter the hostname or IP each other person provides, one per line:|8"
  addline control "label||Everyone Joining your Session must have their external hostnames or IPs listed here."
   showpage   
   numlines numclients clientlist   
   if numclients < 1
      cancel "There must be at least one client joining your game session!"
   endif   
   setvar i 0
   setvar hostport 213
   setvar hosts ""
   setvar control "label||"      
  while i < numclients      
      getline hostaddr clientlist i
      appendstring hostaddr ":"
      appendstring hostaddr hostport      
      appendstring control hostaddr
      appendstring hostaddr METH_UDP      
    addline hosts hostaddr
    math hostport hostport + 1
    math i i + 1
    addline control "label||"
  endwhile
   setvar heading "Important Information"
   setvar subheading "Use this list to inform the other players of their assigned ports."   
   removeblanklines hosts 
  showpage


I am goint to review my code, and do some testing. If this turns out good. I will post this new version here, right next to the fisrt one.
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Carlos_Ed » Tue Apr 05, 2005 5:14 pm

Ark, how can I see if GiT is discarding compressed Armies of Exigo's packets because they get bigger than the uncompressed ones?

(Preliminary tests successful, now comes more tests... and optimizations.)
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Ark » Tue Apr 05, 2005 6:34 pm

You can't, its automatic. It just discards the *compressed* version, and sends the uncompressed version instead. The packet is not completely discarded.
Ark
Site Admin
 
Posts: 2108
Joined: Sat Sep 13, 2003 4:21 pm

Postby Carlos_Ed » Wed Apr 06, 2005 1:58 am

So... there really isn't any way of seing when THAT happens. Right?

That would be usefull, and as I see it, not dificult to add to GiT. It would be nice GiT worked out the average compression gain somehow and displayed it somewhere (perhaps on the connection status screen). It would help to see if we need compression on. I really didn't care, untill I started to feel some latency on the unit responses to my commands in-game. That wouldn't be caused by limited bandwidth because the I still have almost half of it available while playing.
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Postby Carlos_Ed » Wed Apr 06, 2005 11:36 am

The second version is ready. I have tested it minimally, and found it good enough to release it here. :D
Carlos_Ed
 
Posts: 37
Joined: Tue May 18, 2004 6:38 am

Previous

Return to GIT

Who is online

Users browsing this forum: No registered users and 1 guest

cron