[sylverant] r774 committed - Send kill count updates right before a quest starts in a lobby.

1 view
Skip to first unread message

sylv...@googlecode.com

unread,
Jan 2, 2015, 3:17:09 PM1/2/15
to sylverant-...@googlegroups.com
Revision: 774
Author: bluecrab
Date: Fri Jan 2 20:16:53 2015 UTC
Log: Send kill count updates right before a quest starts in a lobby.


https://code.google.com/p/sylverant/source/detail?r=774

Modified:
/trunk/ship_server/src/block.c
/trunk/ship_server/src/lobby.c
/trunk/ship_server/src/lobby.h

=======================================
--- /trunk/ship_server/src/block.c Thu Nov 13 18:11:15 2014 UTC
+++ /trunk/ship_server/src/block.c Fri Jan 2 20:16:53 2015 UTC
@@ -1,6 +1,6 @@
/*
Sylverant Ship Server
- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Lawrence Sebald
+ Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Lawrence Sebald

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
@@ -2350,6 +2350,13 @@
/* Do we have quests configured? */
if(!TAILQ_EMPTY(&ship->qmap)) {
c->cur_lobby->flags |= LOBBY_FLAG_QUESTING;
+
+ /* Send the clients' kill counts if any of them have kill
+ tracking enabled. That way, in case there's an event
running
+ that doesn't allow quest kills to count, the user will
still
+ get an updated count if anything was already killed. */
+ lobby_send_kill_counts(c->cur_lobby);
+
c->cur_lobby->qid = item_id;
c->cur_lobby->qlang = (uint8_t)lang;
load_quest_enemies(c->cur_lobby, item_id,
=======================================
--- /trunk/ship_server/src/lobby.c Mon Dec 29 21:23:30 2014 UTC
+++ /trunk/ship_server/src/lobby.c Fri Jan 2 20:16:53 2015 UTC
@@ -1,6 +1,6 @@
/*
Sylverant Ship Server
- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Lawrence Sebald
+ Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Lawrence Sebald

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
@@ -1499,3 +1499,19 @@

return 1;
}
+
+void lobby_send_kill_counts(lobby_t *l) {
+ int i;
+ ship_client_t *c;
+
+ for(i = 0; i < l->max_clients; ++i) {
+ c = l->clients[i];
+
+ /* Send the client's current count and clear out the counters so
that we
+ don't double count any kills. */
+ if(c && (c->flags & CLIENT_FLAG_TRACK_KILLS)) {
+ shipgate_send_mkill(&ship->sg, c->guildcard, c->cur_block->b,
c, l);
+ memset(c->enemy_kills, 0, sizeof(uint32_t) * 0x60);
+ }
+ }
+}
=======================================
--- /trunk/ship_server/src/lobby.h Mon Dec 29 21:23:30 2014 UTC
+++ /trunk/ship_server/src/lobby.h Fri Jan 2 20:16:53 2015 UTC
@@ -1,6 +1,6 @@
/*
Sylverant Ship Server
- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Lawrence Sebald
+ Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Lawrence Sebald

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
@@ -246,4 +246,8 @@

int lobby_remove_item_locked(lobby_t *l, uint32_t item_id, item_t *rv);

+/* Send the kill counts for all clients in the lobby that have kill
tracking
+ enabled. */
+void lobby_send_kill_counts(lobby_t *l);
+
#endif /* !LOBBY_H */
Reply all
Reply to author
Forward
0 new messages