Soldat Fans > Developers Corner

How about... C# ?

(1/3) > >>

LORD KILLA:
Hi all.  ::)
I've been working on a programm, wich allows you 'scripting' your server in C# using the MS Visual C# Express editor. I know, it's windows only so far and it needs .net framework, but I'll start working on a C++ portable version next days (this better then nothing, not?). The programm communicates with the server over local network (remoting also possible... but not recommended).

How it works: Event packs are sent by a small script over local network to the app, wich processes the data and calls the events. The app only sends the server what it has to do, so all the data structures/functions/other stuff is managed by the app, not by the script.

I dont have yet made all Event senders, nor cmd.* functions. So far only the most needed. (comming soon )

You can:
-> Use OOP (classes, structs, etc.)
-> Real C#
-> The server wont go 'boom' at crash, only the app.
-> Compile the app, and disallow others modifing (only give blabla.exe)
-> idk...

You cant:
-> Run this on linux systems (but soon... ;D )

To start you'd have to do:
-> Replace the main code file with Program.cs
-> Install a very small script wich sends events/recives todos
-> Modify the class 'script'
    - in the class 'cmd' are commands listed, wich you may use
    - over the class 'Events' you can apply wich functions should be called when a events pack is recived


I know, you'll say "but it still uses a script!": The script is small. It really doesnt do much. It's also better then having the complete 'script' in scriptcore... not?

Well, a question before I release it: Would you use this ?

dnmr:
how stable is it? How big scripts have you tested with it? Why dont you just release it and see how people react?

LORD KILLA:
This C# version will be more stable then the script core of course, but the C++ version will be way more better for sure.

I'd like more people to know if they'd use such a thingy. I also havent done yet all events/commands...

dnmr:
examples, darling., We need examples of the code and such

LORD KILLA:
The class 'Accounts' doesnt belong to the app, its for my zombie serv...


--- Code: ---        public static void OnPlayerKill(object[] args)
        {
            Networks.SmartRefresh();
            int shooter = (int)args[0];
            int victim = (int)args[1];
            IsBot(shooter);
            if (victim != shooter)
            {
                Zombies.Type Zombie = Zombies.ZombieTypeByName(Networks.stats.PlayerName[shooter]);
                if (Zombie != Zombies.Type.None)
                {
                    Accounts.Upgrade(shooter, Zombie);
                    if (Accounts.acc[shooter].exp >= Accounts.acc[shooter].maxexp)
                    {
                        Thread.Sleep(400);
                        cmd.DrawText(shooter,
                            "New level: " + Convert.ToString(Accounts.LevelUp(shooter)),
                            360, 1.2, 30, 200, 200, 200, 128);
                    }
                }
            }
        }
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version