@@ -45,6 +45,7 @@ const DEBUG = false
45
45
//globals
46
46
const printChatLog = true
47
47
const printDebugLog = true
48
+ const FORCE_NEW_STATS_UPLOAD = false
48
49
49
50
const tradeCutoff = 4 // in seconds
50
51
var multikillBonus = [... ]float64 {0 , 0 , 0.3 , 0.7 , 1.2 , 2 }
@@ -69,6 +70,7 @@ var killValues = map[string]float64{
69
70
70
71
type game struct {
71
72
//winnerID int
73
+ coreID string
72
74
winnerClanName string
73
75
rounds []* round
74
76
potentialRound * round
@@ -231,6 +233,7 @@ type playerStats struct {
231
233
wlp float64
232
234
mip float64
233
235
rws float64 //round win shares
236
+ eac int //effective assist contributions
234
237
235
238
rwk int //rounds with kills
236
239
@@ -294,6 +297,35 @@ type playerStats struct {
294
297
damageList map [uint64 ]int
295
298
}
296
299
300
+ type Accolades struct {
301
+ awp int
302
+ deagle int
303
+ knife int
304
+ dinks int
305
+ blindKills int
306
+ bombPlants int
307
+ jumps int
308
+ teamDMG int
309
+ selfDMG int
310
+ ping int
311
+ footsteps int //unnecessary processing?
312
+ bombTaps int
313
+ killsThroughSmoke int
314
+ penetrations int
315
+ noScopes int
316
+ midairKills int
317
+ crouchedKills int
318
+ bombzoneKills int
319
+ killsWhileMoving int
320
+ mostMoneySpent int
321
+ mostShotsOnLegs int
322
+ shotsFired int
323
+ ak int
324
+ m4 int
325
+ pistol int
326
+ scout int
327
+ }
328
+
297
329
func main () {
298
330
input_dir := "in"
299
331
files , _ := ioutil .ReadDir (input_dir )
@@ -308,8 +340,6 @@ func main() {
308
340
309
341
var input string
310
342
fmt .Scanln (& input )
311
-
312
- //authenticate()
313
343
}
314
344
315
345
func initGameObject () * game {
@@ -347,6 +377,12 @@ func processDemo(demoName string) {
347
377
}
348
378
defer f .Close ()
349
379
380
+ tempCoreID := strings .Split (demoName , "mid" )
381
+ if len (tempCoreID ) > 1 {
382
+ //we have a CSC match
383
+ game .coreID = strings .Split (strings .Split (demoName , "mid" )[1 ], "." )[0 ]
384
+ }
385
+
350
386
p := dem .NewParser (f )
351
387
defer p .Close ()
352
388
@@ -1012,15 +1048,17 @@ func processDemo(demoName string) {
1012
1048
for deadGuySteam , deadTick := range (* game .potentialRound ).playerStats [e .Victim .SteamID64 ].tradeList {
1013
1049
if tick - deadTick < tradeCutoff * game .tickRate {
1014
1050
pS [deadGuySteam ].traded = 1
1051
+ pS [deadGuySteam ].eac += 1
1015
1052
pS [deadGuySteam ].kastRounds = 1
1016
1053
}
1017
1054
}
1018
1055
}
1019
1056
1020
1057
//assist logic
1021
1058
if assisterExists && victimExists && e .Assister .TeamState .ID () != e .Victim .TeamState .ID () {
1022
- //this logic needs to be replaced
1059
+ //this logic needs to be replaced -yeti does not remember why he wrote this
1023
1060
pS [e .Assister .SteamID64 ].assists += 1
1061
+ pS [e .Assister .SteamID64 ].eac += 1
1024
1062
pS [e .Assister .SteamID64 ].kastRounds = 1
1025
1063
pS [e .Assister .SteamID64 ].suppRounds = 1
1026
1064
assisted = true
@@ -1030,6 +1068,7 @@ func processDemo(demoName string) {
1030
1068
} else if float64 (p .GameState ().IngameTick ()) < pS [e .Victim .SteamID64 ].mostRecentFlashVal {
1031
1069
//this will trigger if there is both a flash assist and a damage assist
1032
1070
pS [pS [e .Victim .SteamID64 ].mostRecentFlasher ].fAss += 1
1071
+ pS [pS [e .Victim .SteamID64 ].mostRecentFlasher ].eac += 1
1033
1072
pS [pS [e .Victim .SteamID64 ].mostRecentFlasher ].suppRounds = 1
1034
1073
flashAssisted = true
1035
1074
}
@@ -1331,6 +1370,15 @@ func processDemo(demoName string) {
1331
1370
1332
1371
endOfMatchProcessing (game )
1333
1372
1373
+ if game .coreID != "" {
1374
+ client := authenticate ()
1375
+ if verifyOriginalMatch (client , game .coreID ) || FORCE_NEW_STATS_UPLOAD {
1376
+ addMatch (client , game )
1377
+ }
1378
+ } else {
1379
+ fmt .Println ("This is not a CSC demo D:" )
1380
+ }
1381
+
1334
1382
fmt .Println ("Demo is complete!" )
1335
1383
//cleanup()
1336
1384
0 commit comments