Jump to content


ekgame

Member Since 07 May 2008
Offline Last Active Feb 21 2012 08:58 AM

Topics I've Started

39dll not receiving packets

15 October 2011 - 02:03 PM

So I am trying to make a custom Minecraft client kinda thing. But before I can start placing and removing blocks with it, I need to work out connecting to the server issues.
I connect to the server, send "handshake" packet and everything seemed to work, untill I found out that my client does not receive packets from the server. After scanning my client with WPE PRO it says the pocket is received, but the code does not seem to pick it up.

Connection to the server script:
global.Server = tcpconnect(global.ServerIP,global.ServerPort, true);
setformat(global.Server, 1);


Handshake packet script:
clearbuffer();
writebyte(02); //0x02
writebyte(00);
writebyte(06);
writestring("e");
writestring("k");
writestring("g");
writestring("a");
writestring("m");
writestring("e");
sendmessage(global.Server);


Packet receiving code:
if global.Connected=false exit;
while(1)
{
  size = receivemessage(global.Server);
  if(size < 0)break;
  if(size == 0)
  {
    print_line("[Info] Connection lost."));
    global.Connected=false;
    break;
  }
  mid = readbyte();
  switch(mid)
  {
    case 2:
      print_line("[Info] Handshake recieved.");
    break;
    
    case 255: 
      print_line("[Info] Server disconnected.");
    break;
  }
}

I've done some debugging and the receivemessage function always return 0, while WPE says its 35.
How do I fix this?

EkGame.comeze.com

17 July 2010 - 01:08 PM

Posted Image


Few days ago I started a website ekgame.comeze.com. Everybody is welcome here!


First of all, yes, this is a gaming website, where I can post anyones game if you just ask! The community can also help you solve problems with your own game.

I hope to see you there Posted Image


ekgame.comeze.com  


Depth Ordering Problem

15 June 2010 - 05:01 PM

So, heres the story:
Im making kinda sub-OS and I have trouble with windows ordering. Now i use this script:
l = 0
repeat instance_number(obj_window)
{
ii = instance_find(obj_window,l)
if ii.active = false
{
ii.depth = -(100+l)
}
else
{
ii.depth = -(100+instance_number(obj_window)+instance_number(obj_player)+1)
}
l+=1
}
This script sets depth by the order of windows created except putting up the one window that is active.
To see this script in action click here.

What i want to happen is that all the windows keep the current order, but putting up only selected window.
Any ideas how to do it?

Converting Number Into Binary

26 May 2010 - 07:10 PM

Now I want to encrypt some numbersand i think converting them into binaries would be the best.

What is binary? Its a number made out of 0's and 1's.

Its a bit difficult to explain how it works, but I'lll try it.
So i have binary 101101 and I want to make it to normal number I would do this:
(1*32)+(0*16)+(1*8)+(1*4)+(0*2)+(1*1)
The result would be 45. But i want to reverse this. Lets say i have 1186 and I want to reverse it to 10010100000. How could i do it?

Also how could I reverse those numbers to hex? I dont yet learned how to count it, but it would be interesting to know.

Loading Files

08 May 2010 - 06:24 PM

  • Title: Loading files
  • Description: An exemple how to load files to game memory and look like the are loaded in game loading process
  • GM Version: :P (I'm not sure about :) )
  • Registered: Yes
  • File Type: *.zip (.*gmk +3 folders with content to load)
  • File Size: ~15 kb
  • File Link: Posted Image


This example shows how to load files (like images, sounds, models, etc...). And also it all looks like loaded in game loading process GM makes before starting the game.