divinesmash
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to code a server

Go down

How to code a server Empty How to code a server

Post  Nugget Mon May 04, 2009 8:20 am

WARNING: This Server CP Follows Under the GUI PUBLIC LICENSE Distribution. If you modifie this program and DO NOT give Credit's Too Me you are In Validation of Lisence.



WHAT IT DOES


This program allows you to: Kick, Announce To, Control, You're player's In-game from a small program. You don't even have too be logged In.



HOW TOO ADD:


You'll first need to Create a new .java file In you're Server files. Name It "CP".

After that, Open the file and Add These Codes:

__________________________________________________ ________________

Code:
@echo off
If exist "C:\Program Files (x86)\" set programfiles=C:\Program Files (x86)
Set pro=%programfiles%\Java\jdk1.6.0_02
Set pro2=%programfiles%\Java\jdk1.6.0_02
Set jac=\bin\javac.Exe
Set jav=\bin\java.Exe
:co1
Set b=0
Set t=7
Goto co2
:co2
Color %b%%t%
:menu
Cls
Title The Perfect Compiler version 2.0
Echo Please choose an option below to do that function.
Echo Keep posted on the Moparscape Tutorials section for
Echo any updates that I post.
Echo.
Echo c - Compile your server.
Echo are - To Run your server.
Echo e - To exit out of the program.
Echo color - Change the Text and Backround colors of this compiler.
Echo reset - Resets your Compiler Logs.
Echo.
Echo.
Set /p c=Option:
If %c%==c goto c
If %c%==C goto c
If %c%==are goto are
If %c%==are goto are
If %c%==color goto color
If %c%==Color goto color
If %c%==COLOR goto color
If %c%==reset goto reset
If %c%==Reset goto reset
If %c%==RESET goto reset
If %c%==e goto e
If %c%==E goto e
If %c%==* goto er
Goto er
:color
Cls
Echo Would you like to change the backround color, change
Echo the text color, or reset it to default?
Echo.
Echo back - Change the backround color.
Echo text - Change the text color.
Echo def - Change all colors back to default.
Echo.
Echo.
Set /p color=Option:
If %color%==back goto back
If %color%==BACK goto back
If %color%==text goto text
If %color%==TEXT goto text
If %color%==def goto co1
If %color%==DEF goto co1
If %color%==* goto er
Goto er
:back
Cls
Echo Please select a color to change the backround to:
Echo.
Echo black
Echo white
Echo red
Echo yellow
Echo green
Echo blue
Echo purple
Echo.
Echo.
Set /p back=Color:
If %back%== black (set b=0)
If %back%== white (set b=7)
If %back%== red (set b=4)
If %back%== yellow (set b=6)
If %back%== green (set b=2)
If %back%== blue (set b=1)
If %back%== purple (set b=5)
Goto co2
:text
Cls
Echo Please select a color to change the text to:
Echo.
Echo black
Echo white
Echo red
Echo yellow
Echo green
Echo blue
Echo purple
Echo.
Echo.
Set /p back=Color:
If %back%== black (set t=0)
If %back%== white (set t=7)
If %back%== red (set t=4)
If %back%== yellow (set t=6)
If %back%== green (set t=2)
If %back%== blue (set t=1)
If %back%== purple (set t=5)
Goto co2
:c
Cls
Title Compiler
Goto cjc
:c2
If exist src (goto cl) else (goto c3)
:c3
If exist *.Java (goto cl2) else (goto ce)
:c4
%javac% -cp . *.Java
Echo Files Compiled Successfully!
Pause
Cls
Goto menu
:c5
%javac% -cp . .\src\*.Java
Echo Files Compiled Successfully!
Pause
Move .\src\*.Class .\classes\
Cls
Goto menu
:ce
Cls
Echo You need to have Java files for this Compiler to Compile.
Pause
Cls
Goto menu
:are
Cls
Title Runserver
Goto cj
:r2
Set rjava=%java% -Xmx1024m -cp .;./jython.Jar;./MySql/mysql-connector-java-3.0.17-ga-bin.Jar server
Cls
Goto r3
:r3
If exist .\classes\server.Class (goto sl2) else (goto r4)
:r4
If exist .\server.Class (goto sl) else (goto se)
:r5
%rjava%
Pause
Cls
Goto menu
:r6
Set rjava=
Set rjava=%java% -cp .;./classes; Server
%rjava%
Pause
Cls
Goto menu
:se
Cls
Title Error
Echo You do not have a Server.Class. Make sure that you have used the
Echo compiler with your server BEFORE you try runing it.
Pause
Cls
Goto menu
:er
Cls
Title Error
Echo Invalid command. Please make sure the commands you type
Echo in are correct.
Pause
Cls
Goto menu
:e
Cls
Exit
:cjc
If exist "%pro%_06%jac%" (goto sjc) else (goto cjc2)
:cjc2
If exist "%pro%_07%jac%" (goto sjc2) else (goto cjc3)
:cjc3
If exist "%pro%_08%jac%" (goto sjc3) else (goto cjc4)
:cjc4
If exist "%pro%_09%jac%" (goto sjc4) else (goto cjc5)
:cjc5
If exist "%pro%_10%jac%" (goto sjc5) else (goto cjc6)
:cjc6
If exist "%pro2%%jac%" (goto sjc6) else (goto cjc7)
:cjc7
If exist "%pro%%jac%" (goto sjc7) else (goto cjc8)
:cjc8
If exist "%pro%_01%jac%" (goto sjc8) else (goto cjc9)
:cjc9
If exist "%pro%_02%jac%" (goto sjc9) else (goto cjc10)
:cjc10
If exist "%pro%_03%jac%" (goto sjc10) else (goto cjc11)
:cjc11
If exist "%pro%_04%jac%" (goto sjc11) else (goto cjc12)
:cjc12
If exist "%pro%_05%jac%" (goto sjc12) else (goto je)
:sjc

Set javac="%pro%_06%jac%"
Goto c2
:sjc2
Set javac="%pro%_07%jac%"
Goto c2
:sjc3
Set javac="%pro%_08%jac%"
Goto c2
:sjc4
Set javac="%pro%_09%jac%"
Goto c2
:sjc5
Set javac="%pro%_10%jac%"
Goto c2
:sjc6
Set javac="%pro2%%jac%"
Goto c2
:sjc7
Set javac="%pro%%jac%"
Goto c2
:sjc8
Set javac="%pro%_01%jac%"
Goto c2
:sjc9
Set javac="%pro%_02%jac%"
Goto c2
:sjc10
Set javac="%pro%_03%jac%"
Goto c2
:sjc11
Set javac="%pro%_04%jac%"
Goto c2
:sjc12
Set javac="%pro%_05%jac%"
Goto c2
:cj
If exist "%pro%_06%jav%" (goto sj) else (goto cj2)
:cj2
If exist "%pro%_07%jav%" (goto sj2) else (goto cj3)
:cj3
If exist "%pro%_08%jav%" (goto sj3) else (goto cj4)
:cj4
If exist "%pro%_09%jav%" (goto sj4) else (goto cj5)
:cj5
If exist "%pro%_10%jav%" (goto sj5) else (goto cj6)
:cj6
If exist "%pro2%%jav%" (goto sj6) else (goto cj7)
:cj7
If exist "%pro%%jav%" (goto sj7) else (goto cj8)
:cj8
If exist "%pro%_01%jav%" (goto sj8) else (goto cj9)
:cj9
If exist "%pro%_02%jav%" (goto sj9) else (goto cj10)
:cj10
If exist "%pro%_03%jav%" (goto sj10) else (goto cj11)
:cj11
If exist "%pro%_04%jav%" (goto sj11) else (goto cj12)
:cj12
If exist "%pro%_05%jav%" (goto sj12) else (goto je)
:sj
Set java="%pro%_06%jav%"
Goto r2
:sj2
Set java="%pro%_07%jav%"
Goto r2
:sj3
Set java="%pro%_08%jav%"
Goto r2
:sj4
Set java="%pro%_09%jav%"
Goto r2
:sj5
Set java="%pro%_10%jav%"
Goto r2
:sj6
Set java="%pro2%%jav%"
Goto r2
:sj7
Set java="%pro%%jav%"
Goto r2
:sj8
Set java="%pro%_01%jav%"
Goto r2
:sj9
Set java="%pro%_02%jav%"
Goto r2
:sj10
Set java="%pro%_03%jav%"
Goto r2
:sj11
Set java="%pro%_04%jav%"
Goto r2
:sj12
Set java="%pro%_05%jav%"
Goto r2
:je
Cls
Title Error
Echo You do not have JDK 5.0 or JDK 6.0. Go to od Taharok's tutorial
Echo on the moparscape Tuturoials section for step-by-step instructions
Echo link to download the newest JDK Update.
Pause
Cls
Goto menu
:sl
Cls
Echo Ran Server at %time% and on %date%. >> "Compile Logs.Txt"
Echo Server was run using %java%. >> "Compile Logs.Txt"
Echo Thank-you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.Txt"
Echo. >> "Compile Logs.Txt"
Goto r5
:sl2
Cls
Echo Ran Server at %time% and on %date%. >> "Compile Logs.Txt"
Echo Server was run using %java%. >> "Compile Logs.Txt"
Echo Thank-you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.Txt"
Echo. >> "Compile Logs.Txt"
Goto r6
:cl
Cls
Echo Compiled Java files at %time% and on %date%. >> "Compile Logs.Txt"
Echo Java files were compiled using %javac%. >> "Compile Logs.Txt"
Echo Thank-you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.Txt"
Echo. >> "Compile Logs.Txt"
Goto c5
:cl2
Cls
Echo Compiled Java files at %time% and on %date%. >> "Compile Logs.Txt"
Echo Java files were compiled using %javac%. >> "Compile Logs.Txt"
Echo Thank-you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.Txt"
Echo. >> "Compile Logs.Txt"
Goto c4
:reset
Cls
Echo Resetting the Compiler's Logs...
Pause
Del "Compile Logs.Txt"
Echo ----------Compiler Logs---------- >> "Compile Logs.Txt"
Echo. >> "Compile Logs.Txt"
Goto menu



Alright, You've Installed you're very own CP
and It should pop up when you press the run.bat



Thanks for looking.. If it didn't help ill make a better one for you. i will be poasting more and more for yall.
Nugget
Nugget

Posts : 12
skillz : 27
Join date : 2009-05-03
Location : Australia

Http://www.idunno.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum