Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stonedDiscord committed Feb 22, 2016
1 parent 1e5ab58 commit d1574fb
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 63 deletions.
12 changes: 6 additions & 6 deletions AOprivateServer.pbp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<section name="data">
<explorer view="" pattern="8"/>
<log show="1"/>
<lastopen date="2016-02-12 01:02" user="Sven" host="SPC"/>
<lastopen date="2016-02-19 20:24" user="Sven" host="SPC"/>
</section>
<section name="files">
<file name="Common.pb">
Expand All @@ -20,7 +20,7 @@
</file>
<file name="main.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="3a74d21aa066ac2b38e1e74fd0d86f67"/>
<fingerprint md5="8f064b7ab243cb670f3be31c6206353c"/>
</file>
<file name="server_shared.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
Expand All @@ -41,8 +41,8 @@
<icon enable="1">..\owner.ico</icon>
<format exe="default" cpu="2"/>
<debugger custom="1" type="ide"/>
<compilecount enable="1" value="999"/>
<buildcount enable="1" value="127"/>
<compilecount enable="1" value="1003"/>
<buildcount enable="1" value="128"/>
<versioninfo enable="1">
<field0 value="2,%COMPILECOUNT,%BUILDCOUNT,0"/>
<field1 value="2.%COMPILECOUNT.%BUILDCOUNT,0"/>
Expand Down Expand Up @@ -75,8 +75,8 @@
<icon enable="0">owner.ico</icon>
<format exe="console" cpu="0"/>
<debugger custom="1" type="ide"/>
<compilecount enable="1" value="999"/>
<buildcount enable="1" value="127"/>
<compilecount enable="1" value="1000"/>
<buildcount enable="1" value="128"/>
<versioninfo enable="1">
<field0 value="2,%COMPILECOUNT,%BUILDCOUNT,0"/>
<field1 value="2,%COMPILECOUNT,%BUILDCOUNT,0"/>
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# serverD
## DER BASS MUSS FICKEN!
## Don't hassle the hoff
You can find the downloads in the release tab

### changelog
* tempbans now possible
* fixed an area bug
* same char bug fixed
* looping music
* roll is more subtle
* lag and crashes fixed
* cleanups

### minimal setup (console version)
Expand Down
Binary file added bplugins/test.dll
Binary file not shown.
Binary file added bplugins/test.exp
Binary file not shown.
Binary file added bplugins/test.lib
Binary file not shown.
13 changes: 8 additions & 5 deletions gui.pb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ If OpenWindow(2,#PB_Ignore,#PB_Ignore,420,263,"serverD",#PB_Window_BorderLess|#P
Open_Window_0()
LoadSettings(0)
Delay(100)
If LoopMusic
CreateThread(@TrackWait(),0)
EndIf
CloseWindow(2)
EndIf

Expand All @@ -65,9 +68,9 @@ Repeat ; Start of the event loop
NStatus=Network(0)
EndIf
Event = WaitWindowEvent(LagShield) ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
If Event = #PB_Event_Gadget

lvstate=GetGadgetState(#Listview_0)
Expand Down Expand Up @@ -241,7 +244,7 @@ DataSection
bannerend:
EndDataSection
; IDE Options = PureBasic 5.31 (Windows - x86)
; CursorPosition = 18
; FirstLine = 2
; CursorPosition = 244
; FirstLine = 196
; Folding = -
; EnableXP
102 changes: 63 additions & 39 deletions main.pb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Global error=0
Global lasterror=0
Global WebSockets=0
Global Logging.b=0
Global LagShield=1
Global LagShield=10
Global public.b=0
Global LogFile$="poker.log"
Global oppass$=""
Expand Down Expand Up @@ -230,7 +230,7 @@ Procedure LoadSettings(reload)
PreferenceGroup("server")
musicmode=ReadPreferenceInteger("musicmode",1)
Replays=ReadPreferenceInteger("replaysave",0)
LagShield=ReadPreferenceInteger("LagShield",0)
LagShield=ReadPreferenceInteger("LagShield",10)
replayline=ReadPreferenceInteger("replayline",400)
scene$=Encode(ReadPreferenceString("case","AAOPublic2"))
msname$=Encode(ReadPreferenceString("Name","serverD"))
Expand Down Expand Up @@ -632,28 +632,26 @@ Procedure MSWait(*usagePointer.Client)
areas(*usagePointer\area)\wait=0
EndProcedure

Procedure TrackWait(*usagePointer.Client)
Define stoploop
If LoopMusic
Define wttime,wtarea,track$
wtarea=*usagePointer\area
track$=areas(*usagePointer\area)\track
wttime=areas(*usagePointer\area)\trackwait
Debug wttime
stoploop=0
If wttime
Repeat
Debug "waiting"
Delay(wttime)
Debug "done waiting"
If areas(wtarea)\track=track$
SendTarget("Area"+Str(wtarea),"MC#"+track$+"#"+Str(characternumber)+"#%",Server)
Else
stoploop=1
Procedure TrackWait(a)
Define stoploop,k,cw
cw=1000
Repeat
For k=0 To Aareas
If Areas(k)\trackwait>1
If Areas(k)\trackwait<cw
cw=Areas(k)\trackwait
EndIf
Debug ElapsedMilliseconds()
If (Areas(k)\trackstart+Areas(k)\trackwait)<ElapsedMilliseconds()
Areas(k)\trackstart=ElapsedMilliseconds()
Debug "changed"
SendTarget("Area"+Str(k),"MC#"+Areas(k)\track+"#"+Str(characternumber)+"#%",Server)
EndIf
EndIf
Until stoploop=1
EndIf
EndIf
Next
Delay(cw)
Debug "r u alive?"
Until LoopMusic=0
EndProcedure

Procedure ListIP(ClientID)
Expand Down Expand Up @@ -1247,11 +1245,9 @@ Procedure HandleAOCommand(*usagePointer.Client)
If *usagePointer\ignoremc=0
If Characters(*usagePointer\CID)\dj
Debug mdur
areas(*usagePointer\area)\trackstart=ElapsedMilliseconds()
areas(*usagePointer\area)\trackwait=mdur
areas(*usagePointer\area)\track=StringField(rawreceive$,3,"#")
If LoopMusic
CreateThread(@TrackWait(),*usagePointer)
EndIf
Sendtarget("Area"+Str(*usagePointer\area),"MC#"+Mid(rawreceive$,coff),*usagePointer)
WriteReplay(rawreceive$)
EndIf
Expand Down Expand Up @@ -1658,17 +1654,21 @@ Procedure HandleAOCommand(*usagePointer.Client)
Case "/kick"
If *usagePointer\perm
akck=KickBan(Mid(ctparam$,7),StringField(ctparam$,3," "),#KICK,*usagePointer)
SendTarget(Str(ClientID),"CT#$HOST#kicked "+Str(akck)+" clients#%",Server)


SendTarget(Str(ClientID),"CT#$HOST#kicked "+Str(akck)+" clients#%",Server)
EndIf

Case "/disconnect"
If *usagePointer\perm
akck=KickBan(Mid(ctparam$,13),StringField(ctparam$,3," "),#DISCO,*usagePointer)
SendTarget(Str(ClientID),"CT#$HOST#disconnected "+Str(akck)+" clients#%",Server)
EndIf

Case "/ban"
If *usagePointer\perm
akck=KickBan(Mid(ctparam$,6),StringField(ctparam$,3," "),#BAN,*usagePointer)
SendTarget(Str(ClientID),"CT#$HOST#banned "+Str(akck)+" clients#%",Server)
EndIf


Case "/mute"
If *usagePointer\perm
akck=KickBan(Mid(ctparam$,7),StringField(ctparam$,3," "),#MUTE,*usagePointer)
Expand Down Expand Up @@ -2006,8 +2006,14 @@ Procedure Network(var)
If Clients()\area>=0
areas(Clients()\area)\players-1
EndIf
CallFunctionFast(Plugins()\gcallback,#DISC)
CallFunctionFast(Plugins()\rawfunction,Clients())
If ListSize(Plugins())
ResetList(Plugins())
While NextElement(Plugins())
pStat=#NONE
CallFunctionFast(Plugins()\gcallback,#DISC)
CallFunctionFast(Plugins()\rawfunction,*usagePointer)
Wend
EndIf
DeleteMapElement(Clients(),Str(ClientID))
rf=1
EndIf
Expand Down Expand Up @@ -2071,8 +2077,14 @@ Procedure Network(var)
CompilerIf #CONSOLE=0
AddGadgetItem(#Listview_0,-1,ip$,Icons(0))
CompilerEndIf
CallFunctionFast(Plugins()\gcallback,#CONN)
CallFunctionFast(Plugins()\rawfunction,Clients())
If ListSize(Plugins())
ResetList(Plugins())
While NextElement(Plugins())
pStat=#NONE
CallFunctionFast(Plugins()\gcallback,#CONN)
CallFunctionFast(Plugins()\rawfunction,*usagePointer)
Wend
EndIf
CompilerIf #WEB
length=ReceiveNetworkData(ClientID, *Buffer, 1024)
Debug "eaoe"
Expand Down Expand Up @@ -2213,8 +2225,8 @@ Procedure Network(var)
While StringField(rawreceive$,sc,"%")<>""
subcommand$=StringField(rawreceive$,sc,"%")+"%"

subcommand$$=ValidateChars(subcommand$$)
length=Len(subcommand$$)
subcommand$=ValidateChars(subcommand$)
length=Len(subcommand$)

If ExpertLog
WriteLog(subcommand$,*usagePointer)
Expand Down Expand Up @@ -2257,6 +2269,14 @@ Procedure Network(var)
If Clients()\area>=0
areas(Clients()\area)\players-1
EndIf
If ListSize(Plugins())
ResetList(Plugins())
While NextElement(Plugins())
pStat=#NONE
CallFunctionFast(Plugins()\gcallback,#DISC)
CallFunctionFast(Plugins()\rawfunction,*usagePointer)
Wend
EndIf
DeleteMapElement(Clients(),Str(ClientID))
rf=1
EndIf
Expand Down Expand Up @@ -2330,11 +2350,15 @@ CompilerElse

*Buffer = AllocateMemory(1024)

WriteLog("Server started",Server)

If public And msthread=0
msthread=CreateThread(@MasterAdvert(),Port)
EndIf

WriteLog("Server started",Server)
If LoopMusic
CreateThread(@TrackWait(),0)
EndIf

Repeat

Expand Down Expand Up @@ -2362,8 +2386,8 @@ CompilerEndIf

End
; IDE Options = PureBasic 5.31 (Windows - x86)
; CursorPosition = 1985
; FirstLine = 2198
; CursorPosition = 1661
; FirstLine = 1641
; Folding = ---
; EnableXP
; EnableCompileCount = 0
Expand Down
8 changes: 4 additions & 4 deletions serverd.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</head>
<body id="markdown-body">
<h1>serverD</h1>
<h2>DER BASS MUSS FICKEN!</h2>
<h2>Don't hassle the hoff</h2>
<h3>changelog</h3>
<ul>
<li>tempbans now possible</li>
<li>fixed an area bug</li>
<li>same char bug fixed</li>
<li>looping music</li>
<li>/roll is more subtle</li>
<li>lag and crashes fixed</li>
<li>cleanups</li>
</ul>
<h3>minimal setup (console version)</h3>
Expand Down
Binary file modified serverd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions serverd.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Version]
Compile=999
Build=127
Compile=1024
Build=128
0.0.0.0
7 changes: 4 additions & 3 deletions shared_headers.pb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Structure area
good.w
evil.w
track.s
trackstart.l
trackwait.i
EndStructure

Expand Down Expand Up @@ -95,7 +96,7 @@ Enumeration
#SWITCH
#MOVE
EndEnumeration
; IDE Options = PureBasic 5.11 (Windows - x64)
; CursorPosition = 77
; FirstLine = 29
; IDE Options = PureBasic 5.31 (Windows - x86)
; CursorPosition = 38
; FirstLine = 20
; EnableXP

0 comments on commit d1574fb

Please sign in to comment.