Weather in 5520+

11/04/2011 12:28 Korvacs#16
Its pretty obvious that you dont understand even the simplest aspects of C# or even logical methodology. Go and learn the basics, then learn how to write a server for conquer.

I mean you dont even know how to use the tools your using correctly, the error being thrown if you right click on it in the error list and click show error help it will take you to a webpage which in 95% of cases explains to you why the error is occuring and how to avoid it.
11/04/2011 16:48 abdeen#17
Quote:
Originally Posted by Korvacs View Post
Its pretty obvious that you dont understand even the simplest aspects of C# or even logical methodology. Go and learn the basics, then learn how to write a server for conquer.

I mean you dont even know how to use the tools your using correctly, the error being thrown if you right click on it in the error list and click show error help it will take you to a webpage which in 95% of cases explains to you why the error is occuring and how to avoid it.
that`s what i am doing , an i learned more .

now i am working on a huge system none worked on it before me , doesn't that mean i am learning anything ?
## Edited
i added it and fixed all issue`s i got. but it`s public void , not public static void , so how to start it from program.cs ?
11/04/2011 16:56 Spirited#18
Quote:
Originally Posted by nTL3fTy View Post
Unless the method is inside of his player class, which he would then loop through the ingame players calling said method to change the map color.

Code:
public class Player
{
    public void ChangeToNightTime()
    {
        const uint COLOR_NIGHT = 0x595959;

        var packet = new Network.GamePackets.Data(true);
        packet.UID = Entity.UID;
        packet.ID = 104;
        packet.dwParam = COLOR_NIGHT;
        Send(Packet);
    }
}

...

foreach (var player in ServerBase.Kernel.GamePool.Values)
{
    player.ChangeToNightTime();
}
You can't declare a constant inside of a method...
also, style rules state that they should be declared first (before variables).
11/04/2011 16:56 abdeen#19
========================

here is my code .

PHP Code:
        public void Nighttime(Client.GameState GC)
        {
            const 
uint COLOR_NIGHT = 0x595959;

            
Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
            
Packet.UID = client.Entity.UID;
            
Packet.ID = 104;
            
Packet.dwParam = COLOR_NIGHT;
            foreach (
Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
            {
                
pclient.Send(Packet);
            }
        }

        public 
uint ScreenColor { get; set; }

        }
    } 


and this code for start it when server starts
PHP Code:
AutoInvite.Nighttime();
            
Console.WriteLine("Its Night Now."); 
but its doesn`t worked :(
11/04/2011 16:56 hyperco#20
well ,

he could just change the "Entity.UID" to according to his source code, for me would be something like:

Code:
client.Entity.UID
well i dont know more than pro4never or Fang but i know such things like this....
11/04/2011 16:59 Spirited#21
Quote:
Originally Posted by abdeen View Post
========================

here is my code .

PHP Code:
        public void Nighttime(Client.GameState GC)
        {
            const 
uint COLOR_NIGHT = 0x595959;

            
Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
            
Packet.UID = client.Entity.UID;
            
Packet.ID = 104;
            
Packet.dwParam = COLOR_NIGHT;
            foreach (
Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
            {
                
pclient.Send(Packet);
            }
        }

        public 
uint ScreenColor { get; set; }

        }
    } 
I'm heart-broken. You didn't read what I said and you chose to read the guy that was very wrong. =[
11/04/2011 17:03 hyperco#22
i cant understand he..

Code:
        public void Nighttime(Client.GameState GC)
        {
            const uint COLOR_NIGHT = 0x595959;

            Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (Client.GameState client in ServerBase.Kernel.GamePool.Values)
            Packet.UID = client.Entity.UID;
            Packet.ID = 104;
            Packet.dwParam = COLOR_NIGHT;
            foreach (Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
            {
                pclient.Send(Packet);
            }
        }

        public uint ScreenColor { get; set; }

        }
    }
What is that "public uint ScreenColor { get; set; } " for?
11/04/2011 17:08 BaussHacker#23
Quote:
Originally Posted by abdeen View Post
that`s what i am doing , an i learned more .

now i am working on a huge system none worked on it before me , doesn't that mean i am learning anything ?
## Edited
i added it and fixed all issue`s i got. but it`s public void , not public static void , so how to start it from program.cs ?
I could start build a computer from scratch, does that mean I know wtf I'm doing?
11/04/2011 17:09 abdeen#24
well i edited it to

PHP Code:
        public static void Nighttime()
        {
            const 
uint COLOR_NIGHT = 0x595959;

            
Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
                
Packet.UID = client.Entity.UID;
            
Packet.ID = 104;
            
Packet.dwParam = COLOR_NIGHT;
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
                
client.Send(Packet);
            
Console.WriteLine("Its Night Now."); 
and i made it start when server start.

but its still wont work for me when i log into game , dose its shall work with time , and changes become when i am in game ?


Quote:
Originally Posted by hyperco View Post
i cant understand he..

Code:
        public void Nighttime(Client.GameState GC)
        {
            const uint COLOR_NIGHT = 0x595959;

            Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (Client.GameState client in ServerBase.Kernel.GamePool.Values)
            Packet.UID = client.Entity.UID;
            Packet.ID = 104;
            Packet.dwParam = COLOR_NIGHT;
            foreach (Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
            {
                pclient.Send(Packet);
            }
        }

        public uint ScreenColor { get; set; }

        }
    }
What is that "public uint ScreenColor { get; set; } " for?

lol i deleted it .

Quote:
Originally Posted by Fаng View Post
I'm heart-broken. You didn't read what I said and you chose to read the guy that was very wrong. =[
Ops ... i am sorry Fang , didn't meant to hurt your heart . :S
11/04/2011 18:34 Lateralus#25
Code:
public void Nighttime(Client.GameState GC)
{
using System.Diagnostics;
     GC.Collect();
     const uint COLOR_NIGHT = 0x595959;
     GC.ChangeMapColor(ScreenColor = COLOR_NIGHT);
     foreach (client.ONLINE in GamePool.onlineCharacters)
	  SeNDPAKET(aVariable);
}

public uint ScreenColor { get; set; }
public byte aVariable { get; protected set; }
11/04/2011 18:38 pro4never#26
Quote:
Originally Posted by Lateralus View Post
Code:
public void Nighttime(Client.GameState GC)
{
     GC.Collect();
     const uint COLOR_NIGHT = 0x595959;
     GC.ChangeMapColor(ScreenColor = COLOR_NIGHT);
     foreach (client.ONLINE in GamePool.onlineCharacters)
	  SeNDPAKET(aVariable);
}

public uint ScreenColor { get; set; }
public byte aVariable { get; protected set; }
:D now you're just being mean.
11/04/2011 18:44 Lateralus#27
In all seriousness, to correct some of these posts, the "UID" field isn't processed by the client (at least on 4267; i doubt it's changed), and you can declare consts wherever, since they get compiled to the value they hold anyway.
11/04/2011 20:16 abdeen#28
well i edited it to

PHP Code:
        public static void Nighttime()
        {
            const 
uint COLOR_NIGHT = 0x595959;

            
Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
                
Packet.UID = client.Entity.UID;
            
Packet.ID = 104;
            
Packet.dwParam = COLOR_NIGHT;
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
                
client.Send(Packet);
            
Console.WriteLine("Its Night Now."); 
and i made it start when server start.

but its still wont work for me when i log into game , dose its shall work with time , and changes become when i am in game ?
11/04/2011 20:58 Spirited#29
Quote:
Originally Posted by abdeen View Post
well i edited it to

PHP Code:
        public static void Nighttime()
        {
            const 
uint COLOR_NIGHT = 0x595959;

            
Network.GamePackets.Data Packet = new Network.GamePackets.Data(true);
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
                
Packet.UID = client.Entity.UID;
            
Packet.ID = 104;
            
Packet.dwParam = COLOR_NIGHT;
            foreach (
Client.GameState client in ServerBase.Kernel.GamePool.Values)
                
client.Send(Packet);
            
Console.WriteLine("Its Night Now."); 
and i made it start when server start.

but its still wont work for me when i log into game , dose its shall work with time , and changes become when i am in game ?
Wtf... you still haven't read what I said. I explained it in full detail... how hard is it to move a line of code and change 1 name... damn dude.
11/04/2011 21:10 abdeen#30
Quote:
Originally Posted by Fаng View Post
Wtf... you still haven't read what I said. I explained it in full detail... how hard is it to move a line of code and change 1 name... damn dude.
hey Fang , i like you LOL

i edited it and now i have no errors , but its don't work correctly .